#import "BraveVortexController.h"
        
#import "BraveVortexModel.h"
#import "BraveVortexCell.h"
#import "Masonry.h"

@interface BraveVortexController () <UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic, strong) UICollectionView *flourishBlossomArtistryCollectionView;
@property (nonatomic, strong) NSMutableArray *radiateModels;

@end

@implementation BraveVortexController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self illuminateInitui];
	[self dreamerUnveilAmazingloadData];
}


//: 懒加载数据模型数组
- (NSMutableArray *)radiateModels {
	if (!_radiateModels) {
		_radiateModels = [NSMutableArray array];
	}
	return _radiateModels;
}

//: 获取数据模型
- (void)dreamerUnveilAmazingloadData {
	
}

//: 初始化页面UI
- (void)illuminateInitui {
	[self.view addSubview:self.flourishBlossomArtistryCollectionView];
	[self.flourishBlossomArtistryCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.edges.equalTo(self.view);
	}];
}


- (UICollectionView *)flourishBlossomArtistryCollectionView {
    if (!_flourishBlossomArtistryCollectionView) {
        UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
        flowLayout.minimumLineSpacing = 10;
        flowLayout.minimumInteritemSpacing = 10;
        flowLayout.itemSize = CGSizeMake(100, 100);
        flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
        
        _flourishBlossomArtistryCollectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
        _flourishBlossomArtistryCollectionView.backgroundColor = UIColor.clearColor;
        _flourishBlossomArtistryCollectionView.delegate = self;
        _flourishBlossomArtistryCollectionView.dataSource = self;
        _flourishBlossomArtistryCollectionView.showsHorizontalScrollIndicator = NO;
        _flourishBlossomArtistryCollectionView.showsVerticalScrollIndicator = NO;
        [_flourishBlossomArtistryCollectionView registerClass:[BraveVortexCell class] forCellWithReuseIdentifier:NSStringFromClass([BraveVortexCell class])];
    }
    return _flourishBlossomArtistryCollectionView;
}

#pragma mark - UICollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.radiateModels.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    BraveVortexCell *magnitude = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([BraveVortexCell class]) forIndexPath:indexPath];
    return magnitude;
}

#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    //: collectioncell 点击
}


@end
